import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;


public class SubSet<T extends Comparable<T>> implements Set<T>   {
	ArrayList<T> store;
	 
	SubSet(){
		store = new ArrayList<T>();
	}
	SubSet(T t){
		store = new ArrayList<T>();
		store.add(t);
	}
		

	public int size() {
		if (store == null){
			return 0;
		}
		else
			return store.size();
	}	
	public boolean add(T e) {
		if(!contains(e) && e != null){
			store.add(e);
			return true;
		}
		return false;
	}
	public boolean addAll(Collection<? extends T> c) {
		Iterator<? extends T> i = c.iterator();
		boolean ret = false;
		while(i.hasNext()){
			ret |= add(i.next()) ;
		}
		return ret;
	}

	public void clear() {
		store = new ArrayList<T>();
	}
	public boolean contains(Object o) {
		return store.contains(o);
	}
	public boolean containsAll(Collection<?> c) {
		return store.containsAll(c);
	}
	public boolean isEmpty() {
		return store.isEmpty(); 
	}
	public boolean remove(Object o) {
		return store.remove(o);
	}
	public boolean removeAll(Collection<?> c) {
		return store.removeAll(c);
	}
	public <T> T[] toArray(T[] a) {
		return store.toArray(a);
	}
	public boolean retainAll(Collection<?> c) {
		return store.retainAll(c);
	}
	public Iterator<T> iterator() {
		return store.iterator();
	}
	public Object[] toArray() {
		return store.toArray();
	}


}
